<!-- task页面使用--目前用不到 -->
<template>
  <div class="title-edit-dropdown-wrap">
    <div class="title-edit-dropdown-header" @click="changeDropdown">
      <div class="title">
        <div class="index">{{ index }}</div>
        <div>{{ dropdownTitle }}</div>
      </div>
      <px-icon>
        <ArrowUp v-show="isDropdown" />
        <ArrowDown v-show="!isDropdown" />
      </px-icon>
    </div>
    <div v-show="isDropdown" class="title-edit-dropdown-content">
      <slot name="content" />
    </div>
    <div class="title-edit-dropdown-btn">
      <slot name="btn" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const props = defineProps(["dropdownTitle", "index"]);
const isDropdown = ref(true);

const changeDropdown = () => {
  isDropdown.value = !isDropdown.value;
};
</script>
<style lang="scss" scoped>
.title-edit-dropdown-wrap {
  position: relative;
  width: 100%;
  margin-top: 16px;

  .title-edit-dropdown-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-weight: bold;
    line-height: 22px;
    color: rgb(0 0 0 / 80%);
    cursor: pointer;
    border-bottom: 1px solid rgb(0 0 0 / 10%);

    .px-icon {
      margin-left: 8px;
      font-size: 16px;
    }
  }

  .index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    color: #fff;
    background-color: #3b82f6;
    border-radius: 50%;
  }

  .title {
    display: flex;
    align-items: center;
    // padding-left: 16px;
    // &::before {
    //   position: absolute;
    //   top: 50%;
    //   left: 0;
    //   display: block;
    //   width: 3px;
    //   height: 16px;
    //   content: "";
    //   background: #3b82f6;
    //   border-radius: 0 100px 100px 0;
    //   transform: translateY(-50%);
    // }
  }

  .title-edit-dropdown-content {
    width: 100%;
  }

  .title-edit-dropdown-btn {
    position: absolute;
    top: 0;
    right: 24px;
    height: 40px;
    line-height: 40px;
  }
}
</style>
